<!doctype html>
<style>
p {display:table}  /* makes reference image smaller */

P#id.r.s[x][Y=d][y=D i][rel=E][x^=a][x|=a][x$=c][x*=b][class~=s]/*
*/:first-child:first-OF-type:nth-of-type(1)/*
*/:is(head + body > p:is(head ~ body p, ?)):not(div p):not(#ID, .R, [y=D])
{
	color: blue
}
#x, { color:red } /* invalid selector */
</style>

<p id=id class="r s" x="a-bc" y=d rel=e>blue
<p id=x>black